package com.gcstorage.tvdev.net;

import com.alibaba.fastjson.annotation.JSONField;
import com.google.gson.annotations.SerializedName;

/**
 * Created by Xu on 2019-10-29 09:46
 */
public class HttpResult<T> {
    @JSONField(alternateNames = {"code","resultcode", "errCode", "errorCode"})
    @SerializedName(value = "code", alternate = {"resultcode", "errCode", "errorCode"})
    private int code;
    @JSONField(alternateNames = {"msg","message", "resultmessage"})
    @SerializedName(value = "msg", alternate = {"message", "resultmessage"})
    private String msg;
    @JSONField(alternateNames = {"data","dataList", "response", "result", "rows", "list", "focalGroupName", "CommandPlateVo"})
    @SerializedName(value = "data", alternate = {"dataList", "response", "result", "rows", "list", "focalGroupName", "CommandPlateVo"})
    private T data;
    private String destination;

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }

    public String getDestination() {
        return destination;
    }

    public void setDestination(String destination) {
        this.destination = destination;
    }

    public boolean isSuccess() {
        return code == 20000;
    }
}
